#include <bits/stdc++.h>
using namespace std;
long long f[2000100] = {0, 0, 1, 1, 2, 5, 6, 12};
int main() {
  int n;
  cin >> n;
  for (int i = 8; i <= n; i++)
    f[i] = (f[i - 2] + f[i - 3] + f[i - 4] + f[i - 5] * 3 + f[i - 6] * 3 +
            f[i - 7]) %
           1000000007;
  cout << f[n];
  return 0;
}
